package com.ali.stickypackage;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

import java.nio.charset.StandardCharsets;

/**
 * 自定义服务端处理器
 */
public class MyStickyPackageServerHandler extends SimpleChannelInboundHandler<MessageProtocol> {
    /**
     * 通道读取
     */
    @Override
    protected void channelRead0(ChannelHandlerContext channelHandlerContext, MessageProtocol messageProtocol) {
        System.out.println("接收消息：" + new String(messageProtocol.getContent(), StandardCharsets.UTF_8));
    }
}
